#include <bits/stdc++.h>
#ifndef DEBUG
#define debug
#endif
using namespace std;
using i64 = int64_t;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  int limit = 512;
  int T;
  cin >> T;
  while (T --) {
    int n;
    cin >> n;
    vector<int> arr(n + 1);
    for (int i = 1; i <= n; i ++) cin >> arr[i];
    vector<int> sum(n + 1);
    for (int i = 1; i <= n; i ++) sum[i] = sum[i - 1] ^ arr[i];

    const int invalid = INT_MAX;
    // [l', r] = k, l' >= l, 左端点大于等于 l，异或和为 k 的最小 r
    vector<vector<int>> sub(n + 1, vector<int>(limit, invalid));
    // [l, a] ^ [b, c] = k， 以 l 为左端点，两个区间异或和为 k 的最小 c
    vector<vector<int>> comb(n + 1, vector<int>(limit, invalid));
    // [d, r] = k 以 r 为右端点，异或和为 k 的最大左端点
    vector<vector<int>> suf(n + 1, vector<int>(limit, INT_MIN));
    // 判断区间是否可以划分
    // [l, a] [b, c] [d, r]
    // 通过 suf[r][k] 找最大的 d
    // 通过 comb[l][k] 找最小的 c
    // dp[l][r] = (comb[l][k] + 1 <= suf[r, k])
    // dp[l][r] 直接记录最佳决策点
    vector<vector<int>> dp(n + 1, vector<int>(n + 1, invalid));
    for (int l = n; l >= 1; l --) {
      dp[l][l] = -1;
      for (int r = l; r <= n; r ++) {
        for (int k = 0; k < limit; k ++) {
          if (comb[l][k] < suf[r][k]) {
            dp[l][r] = k;
            break; // 卡常严重，不 break 竟然超时
          }
        }
        int xor_sum = sum[r] ^ sum[l - 1];
        if (dp[l][r] != invalid) {
          suf[r][xor_sum] = max(suf[r][xor_sum], l);
          sub[l][xor_sum] = min(sub[l][xor_sum], r);
          if (r != n) {
            for (int k = 0; k < limit; k ++) {
              comb[l][k] = min(comb[l][k], sub[r + 1][k ^ xor_sum]);
            }
          }
        }
      }
      if (l != n) {
        for (int k = 0; k < limit; k ++) {
          sub[l][k] = min(sub[l][k], sub[l + 1][k]);
        }
      }
    }
    if (dp[1][n] == invalid) {
      cout << "Shuiniao" << '\n';
      continue;
    }
    cout << "Huoyu" << '\n';

    vector<tuple<int, int, int>> ans;
    auto dfs = [&](auto &self, int l, int r) -> void {
      if (dp[l][r] == -1) return;
      int k = dp[l][r];
      int d = suf[r][k];
      int c = comb[l][k];
      for (int a = l; a < c; a ++) {
        int xor_sum = sum[a] ^ sum[l - 1];
        if (dp[l][a] != invalid && sub[a + 1][k ^ xor_sum] == c) {
          int b = suf[c][k ^ xor_sum];
          self(self, d, r);
          self(self, b, c);
          self(self, l, a);
          ans.emplace_back(l, b - (a - l), d - (c - b) - (a - l));
          break;
        }
      }
    };
    dfs(dfs, 1, n);
    cout << ans.size() << '\n';
    for (auto [l, a, b] : ans) {
      cout << l << " " << a << " " << b << '\n';
    }
  }
}